import { ItemType } from '@/components/workflow/types/hooks';
import React from 'react';

export const useFlowTypeRender = (
  item: ItemType
): React.ReactElement | null => {
  const isFile = item?.fileType;
  const type = item?.type || item?.schema?.type;
  if (
    item?.schema?.value?.type === 'ref' &&
    !item?.schema?.value?.content?.name
  ) {
    return null;
  }
  if (isFile && type?.includes('array')) {
    return (
      <svg
        className="icon-icon icon-icon-coz_folder_bracket "
        width="1em"
        height="1em"
        viewBox="0 0 24 24"
        fill="currentColor"
        xmlns="http://www.w3.org/2000/svg"
      >
        <path d="M1 5C1 3.89543 1.89543 3 3 3H4C4.55228 3 5 3.44772 5 4 5 4.55228 4.55228 5 4 5H3V19H4C4.55228 19 5 19.4477 5 20 5 20.5523 4.55228 21 4 21H3C1.89543 21 1 20.1046 1 19V5zM23 5C23 3.89543 22.1046 3 21 3H20C19.4477 3 19 3.44772 19 4 19 4.55228 19.4477 5 20 5H21V19H20C19.4477 19 19 19.4477 19 20 19 20.5523 19.4477 21 20 21H21C22.1046 21 23 20.1046 23 19V5z"></path>
        <path
          fillRule="evenodd"
          clipRule="evenodd"
          d="M4.5 8C4.5 6.89543 5.39543 6 6.5 6H9.67157C10.202 6 10.7107 6.21071 11.0858 6.58579L12 7.5H17.5C18.6046 7.5 19.5 8.39543 19.5 9.5V16C19.5 17.1046 18.6046 18 17.5 18H6.5C5.39543 18 4.5 17.1046 4.5 16V8ZM10.5858 8.91421C10.9609 9.28929 11.4696 9.5 12 9.5H17.5V16H6.5V8H9.67157L10.5858 8.91421Z"
        ></path>
      </svg>
    );
  }
  if (isFile) {
    return (
      <svg
        className="icon-icon icon-icon-coz_folder "
        width="1em"
        height="1em"
        viewBox="0 0 24 24"
        fill="currentColor"
        xmlns="http://www.w3.org/2000/svg"
      >
        <path
          fillRule="evenodd"
          clipRule="evenodd"
          d="M3 2C1.89543 2 1 2.89543 1 4V19C1 20.1046 1.89543 21 3 21H21C22.1046 21 23 20.1046 23 19V6C23 4.89543 22.1046 4 21 4H12L10.5858 2.58579C10.2107 2.21071 9.70201 2 9.17157 2H3ZM12 6C11.4696 6 10.9609 5.78929 10.5858 5.41421L9.17157 4L3 4L3 19H21V6H12Z"
        ></path>
      </svg>
    );
  }
  if (type === 'string') {
    return 'str.';
  }
  if (type === 'integer') {
    return 'int.';
  }
  if (type === 'number') {
    return (
      <svg
        className="icon-icon icon-icon-coz_number "
        width="1em"
        height="1em"
        viewBox="0 0 24 24"
        fill="currentColor"
        xmlns="http://www.w3.org/2000/svg"
      >
        <path
          fillRule="evenodd"
          clipRule="evenodd"
          d="M17.715 16.6789C16.8103 16.6789 16.036 16.4796 15.392 16.0809C14.9473 15.8049 14.5563 15.4369 14.219 14.9769C13.4063 13.8729 13 12.2859 13 10.2159C13 9.17325 13.0997 8.26092 13.299 7.47892C13.4983 6.66625 13.805 5.98392 14.219 5.43192C15.0317 4.29725 16.197 3.72992 17.715 3.72992C18.589 3.72992 19.348 3.92159 19.992 4.30492C20.452 4.59625 20.8507 4.97192 21.188 5.43192C22.0007 6.55125 22.407 8.14592 22.407 10.2159C22.407 11.2586 22.3073 12.1709 22.108 12.9529C21.9087 13.7503 21.602 14.4249 21.188 14.9769C20.3753 16.1116 19.2177 16.6789 17.715 16.6789ZM17.715 14.5629C18.5277 14.5629 19.141 14.1566 19.555 13.3439C19.6777 13.0986 19.785 12.8073 19.877 12.4699C20.0303 11.8566 20.107 11.1053 20.107 10.2159C20.107 9.55659 20.061 8.96625 19.969 8.44492C19.877 7.89292 19.739 7.43292 19.555 7.06492C19.1563 6.25225 18.543 5.84592 17.715 5.84592C17.1937 5.84592 16.749 6.00692 16.381 6.32892C16.1817 6.52825 16.0053 6.77359 15.852 7.06492C15.484 7.77025 15.3 8.82059 15.3 10.2159C15.3 11.1053 15.3767 11.8566 15.53 12.4699C15.622 12.7919 15.7293 13.0756 15.852 13.3209C16.266 14.1489 16.887 14.5629 17.715 14.5629Z"
        ></path>
        <path d="M13 18.9999C13 18.4477 13.4477 17.9999 14 17.9999H21.41C21.9623 17.9999 22.41 18.4477 22.41 18.9999 22.41 19.5522 21.9623 19.9999 21.41 19.9999H14C13.4477 19.9999 13 19.5522 13 18.9999zM1.5 18.9999C1.5 19.5522 1.94772 19.9999 2.5 19.9999H2.777C3.32928 19.9999 3.777 19.5522 3.777 18.9999V7.90851L8.67379 19.1012C8.91265 19.6471 9.45208 19.9999 10.048 19.9999H10.597C11.1493 19.9999 11.597 19.5522 11.597 18.9999V4.99994C11.597 4.44765 11.1493 3.99994 10.597 3.99994H10.32C9.76771 3.99994 9.32 4.44766 9.32 4.99994V15.7714L4.67235 4.90984C4.43617 4.3579 3.89365 3.99994 3.29329 3.99994H2.5C1.94772 3.99994 1.5 4.44765 1.5 4.99994V18.9999z"></path>
      </svg>
    );
  }
  if (type === 'object') {
    return (
      <svg
        className="icon-icon icon-icon-coz_brace "
        width="1em"
        height="1em"
        viewBox="0 0 24 24"
        fill="currentColor"
        xmlns="http://www.w3.org/2000/svg"
      >
        <path d="M17 1.5C18.6569 1.5 20 2.84315 20 4.5V9.5C20 10.3284 20.6716 11 21.5 11H22C22.5523 11 23 11.4477 23 12 23 12.5523 22.5523 13 22 13H21.5C20.6716 13 20 13.6716 20 14.5V19.5C20 21.1569 18.6569 22.5 17 22.5H16.5C15.9477 22.5 15.5 22.0523 15.5 21.5 15.5 20.9477 15.9477 20.5 16.5 20.5H17C17.5523 20.5 18 20.0523 18 19.5V14.5C18 13.5207 18.4022 12.6353 19.0505 12 18.4022 11.3647 18 10.4793 18 9.5V4.5C18 3.94772 17.5523 3.5 17 3.5H16.5C15.9477 3.5 15.5 3.05228 15.5 2.5 15.5 1.94772 15.9477 1.5 16.5 1.5H17zM4 19.5C4 21.1569 5.34315 22.5 7 22.5H7.5C8.05228 22.5 8.5 22.0523 8.5 21.5 8.5 20.9477 8.05228 20.5 7.5 20.5H7C6.44772 20.5 6 20.0523 6 19.5V14.5C6 13.5207 5.59777 12.6353 4.94949 12 5.59777 11.3647 6 10.4793 6 9.5V4.5C6 3.94772 6.44772 3.5 7 3.5H7.5C8.05228 3.5 8.5 3.05228 8.5 2.5 8.5 1.94772 8.05228 1.5 7.5 1.5H7C5.34315 1.5 4 2.84315 4 4.5V9.5C4 10.3284 3.32843 11 2.5 11H2C1.44772 11 1 11.4477 1 12 1 12.5523 1.44772 13 2 13H2.5C3.32843 13 4 13.6716 4 14.5V19.5z"></path>
      </svg>
    );
  }
  if (type === 'boolean') {
    return (
      <svg
        className="icon-icon icon-icon-coz_boolean "
        width="1em"
        height="1em"
        viewBox="0 0 24 24"
        fill="currentColor"
        xmlns="http://www.w3.org/2000/svg"
      >
        <g clipPath="url(#svg_6fe9197f47__clip0_420_4888)">
          <path
            fillRule="evenodd"
            clipRule="evenodd"
            d="M12 18.9297C10.8233 19.6104 9.45715 20 8 20C3.58172 20 0 16.4183 0 12C0 7.58172 3.58172 4 8 4C9.65685 4 11.1961 4.50368 12.4729 5.36627C12.319 5.2623 12.1613 5.16355 12 5.07026C13.1767 4.38958 14.5429 4 16 4C20.4183 4 24 7.58172 24 12C24 16.4183 20.4183 20 16 20C14.5429 20 13.1767 19.6104 12 18.9297ZM2 12C2 8.68629 4.68629 6 8 6C11.3137 6 14 8.68629 14 12C14 15.3137 11.3137 18 8 18C4.68629 18 2 15.3137 2 12Z"
          ></path>
        </g>
        <defs>
          <clipPath id="svg_6fe9197f47__clip0_420_4888">
            <path d="M0 0H24V24H0z"></path>
          </clipPath>
        </defs>
      </svg>
    );
  }
  if (type === 'array-string') {
    return (
      <svg
        className="icon-icon icon-icon-coz_string_bracket "
        width="1em"
        height="1em"
        viewBox="0 0 24 24"
        fill="currentColor"
        xmlns="http://www.w3.org/2000/svg"
      >
        <path d="M3 3C1.89543 3 1 3.89543 1 5V19C1 20.1046 1.89543 21 3 21H4C4.55228 21 5 20.5523 5 20 5 19.4477 4.55228 19 4 19H3V5H4C4.55228 5 5 4.55228 5 4 5 3.44772 4.55228 3 4 3H3zM21 3C22.1046 3 23 3.89543 23 5V19C23 20.1046 22.1046 21 21 21H20C19.4477 21 19 20.5523 19 20 19 19.4477 19.4477 19 20 19H21V5H20C19.4477 5 19 4.55228 19 4 19 3.44772 19.4477 3 20 3H21z"></path>
        <path d="M17.908 17.265C18.18 17.537 18.4973 17.673 18.86 17.673 19.2227 17.673 19.54 17.537 19.812 17.265 20.0727 17.0044 20.203 16.687 20.203 16.313 20.203 15.9277 20.0727 15.6047 19.812 15.344 19.5513 15.072 19.234 14.936 18.86 14.936 18.4973 14.936 18.18 15.072 17.908 15.344 17.636 15.616 17.5 15.939 17.5 16.313 17.5 16.6757 17.636 16.993 17.908 17.265zM15.969 17.5031C15.4338 17.5031 15 17.0692 15 16.5341V9.23255C15 8.70208 15.43 8.27205 15.9605 8.27205 16.491 8.27205 16.921 8.70208 16.921 9.23255V9.44505C17.125 8.99172 17.38 8.65172 17.686 8.42505 17.9807 8.20972 18.3093 8.10205 18.672 8.10205 18.7586 8.10205 18.8416 8.10786 18.921 8.11949 19.361 8.18384 19.5117 8.67936 19.4138 9.11309L19.2686 9.75589C19.1893 10.1072 18.7431 10.2441 18.383 10.2441 18.1337 10.2441 17.907 10.3177 17.703 10.4651 17.567 10.5557 17.4423 10.6861 17.329 10.8561 17.0683 11.2641 16.938 11.8421 16.938 12.5901V16.5341C16.938 17.0692 16.5042 17.5031 15.969 17.5031zM11.761 17.503C12.0783 17.639 12.441 17.707 12.849 17.707 13.2343 17.707 13.58 17.6447 13.886 17.52 13.9543 17.4973 14.0198 17.4722 14.0826 17.4449 14.5094 17.2592 14.5864 16.7362 14.4053 16.3074L14.3826 16.2535C14.2352 15.9044 13.7041 15.8209 13.3255 15.836 13.3085 15.8367 13.2913 15.837 13.274 15.837 13.0133 15.837 12.8207 15.752 12.696 15.582 12.628 15.5027 12.577 15.3894 12.543 15.242 12.509 15.0947 12.492 14.9247 12.492 14.732V9.87004H13.682C14.1233 9.87004 14.481 9.51231 14.481 9.07104 14.481 8.62976 14.1233 8.27204 13.682 8.27204H12.492V6.75904C12.492 6.22388 12.0582 5.79004 11.523 5.79004 10.9878 5.79004 10.554 6.22387 10.554 6.75904V8.27204H10.299C9.85772 8.27204 9.5 8.62976 9.5 9.07104 9.5 9.51231 9.85772 9.87004 10.299 9.87004H10.554V14.8C10.554 15.208 10.5823 15.565 10.639 15.871 10.6957 16.1884 10.775 16.449 10.877 16.653 11.013 16.9137 11.1943 17.129 11.421 17.299 11.5343 17.3784 11.6477 17.4464 11.761 17.503zM6.50197 17.7069C5.70864 17.7182 5.03431 17.5652 4.47897 17.2479 4.18336 17.0754 3.92958 16.8595 3.71764 16.6 3.394 16.2039 3.56122 15.6388 3.97172 15.3335 4.29684 15.0918 4.7542 15.2226 5.05312 15.4961 5.13863 15.5743 5.23058 15.6426 5.32897 15.7009 5.65764 15.8935 6.04864 15.9899 6.50197 15.9899 6.87597 15.9899 7.16497 15.8935 7.36897 15.7009 7.57297 15.5195 7.68064 15.2419 7.69197 14.8679 7.69197 14.6865 7.65231 14.5222 7.57297 14.3749 7.50497 14.2502 7.40297 14.1425 7.26697 14.0519 7.06297 13.9385 6.71164 13.8139 6.21297 13.6779 5.35164 13.4399 4.72831 13.1509 4.34297 12.8109 4.11631 12.6069 3.94064 12.3575 3.81597 12.0629 3.69131 11.7455 3.62897 11.3772 3.62897 10.9579 3.62897 10.4705 3.70264 10.0455 3.84997 9.68287 3.97464 9.33154 4.17297 9.0312 4.44497 8.78187 4.95497 8.30587 5.64064 8.06787 6.50197 8.06787 7.18197 8.06787 7.77697 8.20954 8.28697 8.49287 8.48224 8.60515 8.66068 8.74055 8.8223 8.89909 9.20446 9.27395 9.05024 9.88201 8.61538 10.1942 8.31338 10.411 7.90071 10.2959 7.6082 10.0664 7.56393 10.0317 7.51819 10.0002 7.47097 9.97187 7.22164 9.82454 6.91564 9.7452 6.55297 9.73387 6.25831 9.73387 6.02597 9.81887 5.85597 9.98887 5.65197 10.1815 5.54997 10.4365 5.54997 10.7539 5.54997 10.9352 5.57831 11.0882 5.63497 11.2129 5.69164 11.3375 5.77664 11.4395 5.88997 11.5189 6.02597 11.6435 6.32064 11.7625 6.77397 11.8759 7.70331 12.1252 8.37197 12.4142 8.77997 12.7429 9.05197 12.9582 9.25597 13.2189 9.39197 13.5249 9.53931 13.8535 9.61297 14.2332 9.61297 14.6639 9.61297 15.1512 9.54497 15.5875 9.40897 15.9729 9.26164 16.3469 9.05197 16.6699 8.77997 16.9419 8.21331 17.4519 7.45397 17.7069 6.50197 17.7069z"></path>
      </svg>
    );
  }
  if (type === 'array-integer') {
    return (
      <svg
        className="icon-icon icon-icon-coz_number_int_bracket "
        width="1em"
        height="1em"
        viewBox="0 0 24 24"
        fill="currentColor"
        xmlns="http://www.w3.org/2000/svg"
      >
        <path d="M3 3C1.89543 3 1 3.89543 1 5V19C1 20.1046 1.89543 21 3 21H4C4.55228 21 5 20.5523 5 20 5 19.4477 4.55228 19 4 19H3V5H4C4.55228 5 5 4.55228 5 4 5 3.44772 4.55228 3 4 3H3zM23 5C23 3.89543 22.1046 3 21 3H20C19.4477 3 19 3.44772 19 4 19 4.55228 19.4477 5 20 5H21V14.5266C21.3864 14.6355 21.734 14.8456 22.0266 15.1485 22.4791 15.6048 22.703 16.1833 22.703 16.817 22.703 17.4519 22.4704 18.0249 22.0191 18.4761 21.5722 18.923 21.0052 19.177 20.36 19.177 20.1088 19.177 19.8694 19.1385 19.6444 19.0651 19.2677 19.2085 19 19.573 19 20 19 20.5523 19.4477 21 20 21H21C22.1046 21 23 20.1046 23 19V5zM17.3255 16.332C17.5438 16.3233 17.8127 16.3474 18.0296 16.4362 18.01 16.56 18 16.687 18 16.817 18 17.1882 18.0841 17.5336 18.2406 17.845 18.1945 17.8827 18.142 17.9151 18.0826 17.9409 18.0198 17.9683 17.9543 17.9933 17.886 18.0161 17.58 18.1407 17.2343 18.2031 16.849 18.2031 16.441 18.2031 16.0783 18.1351 15.761 17.9991 15.6477 17.9424 15.5343 17.8744 15.421 17.7951 15.1943 17.6251 15.013 17.4097 14.877 17.1491 14.775 16.9451 14.6957 16.6844 14.639 16.3671 14.5823 16.0611 14.554 15.7041 14.554 15.2961V10.3661H14.299C13.8577 10.3661 13.5 10.0083 13.5 9.56706 13.5 9.12578 13.8577 8.76806 14.299 8.76806H14.554V7.25506C14.554 6.7199 14.9878 6.28606 15.523 6.28606 16.0582 6.28606 16.492 6.7199 16.492 7.25506V8.76806H17.682C18.1233 8.76806 18.481 9.12578 18.481 9.56706 18.481 10.0083 18.1233 10.3661 17.682 10.3661H16.492V15.2281C16.492 15.4207 16.509 15.5907 16.543 15.7381 16.577 15.8854 16.628 15.9987 16.696 16.0781 16.8207 16.2481 17.0133 16.3331 17.274 16.3331 17.2913 16.3331 17.3085 16.3327 17.3255 16.332zM7 17.0355C7 17.5659 7.43003 17.996 7.9605 17.996 8.49097 17.996 8.921 17.5659 8.921 17.0355V12.522C8.921 11.8646 9.04567 11.366 9.295 11.026 9.38567 10.89 9.49333 10.7823 9.618 10.703 9.822 10.567 10.0543 10.499 10.315 10.499 10.723 10.499 11.012 10.6576 11.182 10.975 11.25 11.111 11.301 11.2866 11.335 11.502 11.369 11.706 11.386 11.944 11.386 12.216V17.027C11.386 17.5621 11.8198 17.996 12.355 17.996 12.8902 17.996 13.324 17.5621 13.324 17.027V11.757C13.324 10.7256 13.1257 9.93796 12.729 9.39396 12.5363 9.13329 12.2983 8.93496 12.015 8.79896 11.709 8.6403 11.3407 8.56096 10.91 8.56096 10.4793 8.56096 10.0997 8.64596 9.771 8.81596 9.40833 8.98596 9.125 9.25796 8.921 9.63196 8.921 9.15313 8.53283 8.76496 8.054 8.76496H7.9605C7.43003 8.76496 7 9.19499 7 9.72546V17.0355z"></path>
        <path d="M4 6.61005C4 6.11852 4.39847 5.72005 4.89 5.72005H5.048C5.53953 5.72005 5.938 6.11852 5.938 6.61005 5.938 7.10158 5.53953 7.50005 5.048 7.50005H4.89C4.39847 7.50005 4 7.10158 4 6.61005zM5.938 17.027C5.938 17.5622 5.50416 17.996 4.969 17.996 4.43384 17.996 4 17.5622 4 17.027V9.734C4 9.19884 4.43384 8.765 4.969 8.765 5.50416 8.765 5.938 9.19884 5.938 9.734V17.027zM19.408 17.769C19.68 18.041 19.9973 18.177 20.36 18.177 20.7227 18.177 21.04 18.041 21.312 17.769 21.5727 17.5083 21.703 17.191 21.703 16.817 21.703 16.4317 21.5727 16.1087 21.312 15.848 21.0513 15.576 20.734 15.44 20.36 15.44 19.9973 15.44 19.68 15.576 19.408 15.848 19.136 16.12 19 16.443 19 16.817 19 17.1797 19.136 17.497 19.408 17.769z"></path>
      </svg>
    );
  }
  if (type === 'array-number') {
    return (
      <svg
        className="icon-icon icon-icon-coz_number_bracket "
        width="1em"
        height="1em"
        viewBox="0 0 24 24"
        fill="currentColor"
        xmlns="http://www.w3.org/2000/svg"
      >
        <path d="M3 3C1.89543 3 1 3.89543 1 5V19C1 20.1046 1.89543 21 3 21H4C4.55228 21 5 20.5523 5 20 5 19.4477 4.55228 19 4 19H3V5H4C4.55228 5 5 4.55228 5 4 5 3.44772 4.55228 3 4 3H3zM23 5C23 3.89543 22.1046 3 21 3H20C19.4477 3 19 3.44772 19 4 19 4.55228 19.4477 5 20 5H21V19H20C19.4477 19 19 19.4477 19 20 19 20.5523 19.4477 21 20 21H21C22.1046 21 23 20.1046 23 19V5z"></path>
        <path d="M13.2 17C13.2 16.4477 13.6477 16 14.2 16H18.7C19.2523 16 19.7 16.4477 19.7 17C19.7 17.5523 19.2523 18 18.7 18H14.2C13.6477 18 13.2 17.5523 13.2 17Z"></path>
        <path
          fillRule="evenodd"
          clipRule="evenodd"
          d="M14.8818 14.1421C15.3263 14.3807 15.8515 14.5 16.4576 14.5C17.4778 14.5 18.2707 14.152 18.8364 13.4561C19.1192 13.0982 19.3364 12.6558 19.4879 12.1289C19.6293 11.5921 19.7 10.9708 19.7 10.2649C19.7 8.86316 19.4121 7.79444 18.8364 7.05877C18.5939 6.77047 18.3212 6.53684 18.0182 6.35789C17.5737 6.1193 17.0535 6 16.4576 6C15.4273 6 14.6293 6.35292 14.0636 7.05877C13.7808 7.41667 13.5636 7.86404 13.4121 8.40088C13.2707 8.93772 13.2 9.55906 13.2 10.2649C13.2 11.6667 13.4879 12.7304 14.0636 13.4561C14.296 13.7444 14.5687 13.9731 14.8818 14.1421ZM17.397 12.0246C17.195 12.4421 16.8818 12.6509 16.4576 12.6509C16.0232 12.6509 15.7051 12.4322 15.503 11.9947C15.4424 11.8655 15.3919 11.7164 15.3515 11.5474C15.2707 11.2094 15.2303 10.7819 15.2303 10.2649C15.2303 9.45965 15.3212 8.86813 15.503 8.49035C15.5838 8.33129 15.6747 8.20205 15.7758 8.10263C15.9576 7.93363 16.1848 7.84912 16.4576 7.84912C16.8818 7.84912 17.1899 8.06286 17.3818 8.49035C17.4828 8.68918 17.5535 8.94269 17.5939 9.25088C17.6343 9.54912 17.6545 9.88713 17.6545 10.2649C17.6545 10.7819 17.6192 11.2094 17.5485 11.5474C17.5081 11.7263 17.4576 11.8854 17.397 12.0246Z"
        ></path>
        <path d="M5.46854 18C4.93363 18 4.5 17.5664 4.5 17.0315V7C4.5 6.44772 4.94772 6 5.5 6H5.75731C6.36834 6 6.9183 6.37064 7.14764 6.937L10.0795 14.1771V6.96026C10.0795 6.42993 10.5094 6 11.0397 6C11.5701 6 12 6.42993 12 6.96026V17C12 17.5523 11.5523 18 11 18H10.9296C10.3245 18 9.77863 17.6364 9.54545 17.078L6.43709 9.63429V17.0315C6.43709 17.5664 6.00345 18 5.46854 18Z"></path>
      </svg>
    );
  }
  if (type === 'array-boolean') {
    return (
      <svg
        className="icon-icon icon-icon-coz_boolean_bracket "
        width="1em"
        height="1em"
        viewBox="0 0 24 24"
        fill="currentColor"
        xmlns="http://www.w3.org/2000/svg"
      >
        <path d="M1 5C1 3.89543 1.89543 3 3 3H4C4.55228 3 5 3.44772 5 4 5 4.55228 4.55228 5 4 5H3V19H4C4.55228 19 5 19.4477 5 20 5 20.5523 4.55228 21 4 21H3C1.89543 21 1 20.1046 1 19V5zM23 5C23 3.89543 22.1046 3 21 3H20C19.4477 3 19 3.44772 19 4 19 4.55228 19.4477 5 20 5H21V19H20C19.4477 19 19 19.4477 19 20 19 20.5523 19.4477 21 20 21H21C22.1046 21 23 20.1046 23 19V5z"></path>
        <path
          fillRule="evenodd"
          clipRule="evenodd"
          d="M10 17.5C10.7056 17.5 11.3802 17.3671 12 17.125C12.6199 17.3671 13.2945 17.5 14.0001 17.5C17.0376 17.5 19.5 15.0376 19.5 12C19.5 8.96243 17.0376 6.5 14.0001 6.5C13.2945 6.5 12.6199 6.63287 12 6.87495C11.3802 6.63287 10.7056 6.5 10 6.5C6.96243 6.5 4.5 8.96243 4.5 12C4.5 15.0376 6.96243 17.5 10 17.5ZM10 15.5C11.933 15.5 13.5 13.933 13.5 12C13.5 10.067 11.933 8.5 10 8.5C8.067 8.5 6.5 10.067 6.5 12C6.5 13.933 8.067 15.5 10 15.5Z"
        ></path>
      </svg>
    );
  }
  if (type === 'array-object') {
    return (
      <svg
        className="icon-icon icon-icon-coz_brace_bracket "
        width="1em"
        height="1em"
        viewBox="0 0 24 24"
        fill="currentColor"
        xmlns="http://www.w3.org/2000/svg"
      >
        <path d="M1 5C1 3.89543 1.89543 3 3 3H4C4.55228 3 5 3.44772 5 4 5 4.55228 4.55228 5 4 5H3V19H4C4.55228 19 5 19.4477 5 20 5 20.5523 4.55228 21 4 21H3C1.89543 21 1 20.1046 1 19V5zM23 5C23 3.89543 22.1046 3 21 3H20C19.4477 3 19 3.44772 19 4 19 4.55228 19.4477 5 20 5H21V19H20C19.4477 19 19 19.4477 19 20 19 20.5523 19.4477 21 20 21H21C22.1046 21 23 20.1046 23 19V5z"></path>
        <path d="M6.13636 7.36364C6.13636 6.05824 7.1946 5 8.5 5 9.05229 5 9.5 5.44772 9.5 6 9.5 6.55228 9.05229 7 8.5 7 8.29917 7 8.13636 7.16281 8.13636 7.36364V10.3636C8.13636 10.9819 7.92355 11.5504 7.56719 12 7.92355 12.4496 8.13636 13.0181 8.13636 13.6364V16.6364C8.13636 16.8372 8.29917 17 8.5 17 9.05229 17 9.5 17.4477 9.5 18 9.5 18.5523 9.05229 19 8.5 19 7.1946 19 6.13636 17.9418 6.13636 16.6364V13.6364C6.13636 13.2849 5.85145 13 5.5 13 4.94772 13 4.5 12.5523 4.5 12 4.5 11.4477 4.94772 11 5.5 11 5.85145 11 6.13636 10.7151 6.13636 10.3636V7.36364zM17.8636 7.36364C17.8636 6.05824 16.8054 5 15.5 5 14.9477 5 14.5 5.44772 14.5 6 14.5 6.55228 14.9477 7 15.5 7 15.7008 7 15.8636 7.16281 15.8636 7.36364V10.3636C15.8636 10.9819 16.0764 11.5504 16.4328 12 16.0764 12.4496 15.8636 13.0181 15.8636 13.6364V16.6364C15.8636 16.8372 15.7008 17 15.5 17 14.9477 17 14.5 17.4477 14.5 18 14.5 18.5523 14.9477 19 15.5 19 16.8054 19 17.8636 17.9418 17.8636 16.6364V13.6364C17.8636 13.2849 18.1485 13 18.5 13 19.0523 13 19.5 12.5523 19.5 12 19.5 11.4477 19.0523 11 18.5 11 18.1485 11 17.8636 10.7151 17.8636 10.3636V7.36364z"></path>
      </svg>
    );
  }
  // 默认返回null，如果没有匹配的类型
  return null;
};
